<%@page import="java.sql.Date"%>
<%@page import="form.ConnectionDB"%>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.ResultSet"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<jsp:include page="Admin_includes/header.jsp"></jsp:include>
<style type="text/css">
.xoa {
	text-indent: -99999px;
	width: 28px;
	height: 23px;
	background: url("Admin_images/xoa.png") no-repeat center;
	border: none;
}

.sua {
	text-indent: -99999px;
	width: 28px;
	height: 23px;
	background: url("Admin_images/sua.png");
	border: none;
}
</style>
<div id="center-content">
	<div id="left">
		<jsp:include page="Admin_includes/left.jsp"></jsp:include>
	</div>
	<!-- end left -->







	<div id="right">
		<a href="Admin_sukien.jsp" class="btlink">Danh sách sự kiện</a> <a
			href="Admin_themsukien.jsp" class="btlink">Thêm sự kiện</a>
		<fieldset>
			<table class="table1" width="740">
				<legend> Danh sách sự kiện</legend>
				<tr>
					<th>Id</th>
					<th>Tên sự kiện</th>
					<th>Ngày diễn ra</th>
					<th>Ngày kết thúc</th>
					<th>Địa điểm</th>
					<th>Title</th>
					<th>Hình</th>
					<th>Nội dung</th>
					<th>Sửa</th>
					<th>Xóa</th>
				</tr>
				<%
					String sql = "select * from sukien";
					ResultSet rs = null;
					String err = "";
					try {
						rs = ConnectionDB.getConnection().createStatement()
								.executeQuery(sql);
						while (rs.next()) {
							String sukien_id = rs.getString("sukien_id");
							String tensukien = rs.getString("tensukien");
							Date ngaydienra = rs.getDate("ngaydienra");
							Date ngayketthuc = rs.getDate("ngayketthuc");
							String diadiem = rs.getString("diadiem");
							String title = rs.getString("title");
							String hinh = rs.getString("hinh");
							String noidung = rs.getString("noidung");
				%>
				<tr>
					<td><%=sukien_id%></td>
					<td><%=tensukien%></td>
					<td><%=ngaydienra%></td>
					<td><%=ngayketthuc%></td>
					<td><%=diadiem%></td>
					<td><%=title%></td>
					<td><img src="<%=hinh%>" width="30" height="30" /></td>
					<td class="noidung" style="padding: 2px;">
						<form>
							<textarea name="" cols="" rows="" readonly
								style="width: 100px; height: 40px; margin: 0px; padding: 0px"><%=noidung%></textarea>
						</form>

					</td>
					<td class="suaxoa"><form action="Admin_suathanhvien.jsp" method="post"><input 
						type="submit" value="<%=sukien_id%>" name="email" class="sua"  title="Sửa"/></form>
				</td>


				<td class="suaxoa"><form action="xoathanhvien" method="post">

						<input type="submit" onclick="return confirmAction()"
							value="<%=sukien_id%>" name="email" class="xoa" title="Xóa"/>

					</form></td>
				</tr>
				<%
					}
				%>
				<%
					} catch (Exception e) {
						err = "Hệ thống chưa kết nối cơ sở dữ liệu!Chúng tôi sẽ nhanh chóng khắc phục!";
					}
				%>

			</table>
		</fieldset>
	</div>
	<label style="color: #EE2C2C; font-size: 18px; font-weight: bold;"><%=err%></label>
	<!-- end right -->




</div>
<!-- end center-content-->
<jsp:include page="Admin_includes/footer.jsp"></jsp:include>